﻿namespace MailChimp

open System
open System.Collections.Generic
open MailChimp.Types

//==================================================================================
//  ExportApi
//==================================================================================

[<Sealed>]
/// <summary>MailChimp Export API wrapper.</summary>
type ExportApi =
    inherit ApiBase

    new : apiKey:string * secure:bool -> ExportApi

    //------------------------------------------------------------------------------
    //  (*) List
    //------------------------------------------------------------------------------

    /// <summary>Exports/dumps members of a list and all of their associated details.</summary>
    /// <remarks>C# specific optional parameters.</remarks>
    /// <param name="listID">The list id to get members from.</param>
    /// <param name="status">[optional] The status to get members for.
    /// <para>Defaults to subscribed.</para></param>
    /// <param name="segmentOpts">[optional] Pull only a certain Segment of your list.
    /// <para>For help with what this object should contain refer to
    /// <see cref="MailChimp.MCApi.CampaignSegmentTest"/>.</para></param>
    /// <param name="since">[optional] Return members whose data has changed since a GMT timestamp.</param>
    /// <returns>Parsed list data.</returns>
    member List : listID:string * status:List.MemberStatus opt *
        segmentOpts:Campaign.SegmentOptions opt * since:DateTime opt -> Export.ListData

    /// <summary>Exports/dumps members of a list and all of their associated details.</summary>
    /// <remarks>F# specific optional parameters.</remarks>
    /// <param name="listID">The list id to get members from.</param>
    /// <param name="status">[optional] The status to get members for.
    /// <para>Defaults to subscribed.</para></param>
    /// <param name="segmentOpts">[optional] Pull only a certain Segment of your list.
    /// <para>For help with what this object should contain refer to
    /// <see cref="MailChimp.MCApi.CampaignSegmentTest"/></para></param>
    /// <param name="since">[optional] Return members whose data has changed since a GMT timestamp.</param>
    /// <returns>Parsed list data</returns>
    member List : listID:string * ?status:List.MemberStatus *
        ?segmentOpts:Campaign.SegmentOptions * ?since:DateTime -> Export.ListData

    //------------------------------------------------------------------------------
    //  (*) Campaign Subscriber Activity
    //------------------------------------------------------------------------------

    /// <summary>Exports/dumps all Subscriber Activity for the requested campaign.</summary>
    /// <remarks>C# specific optional parameters.</remarks>
    /// <param name="campaignID">The campaign id to retrieve stats for.</param>
    /// <param name="includeEmpty">[optional] If set to true a record for every email
    /// address sent to will be returned even if there is no activity data.
    /// <para>Defaults to false.</para></param>
    /// <param name="since">[optional] Returns activity recorded since a GMT timestamp.</param>
    /// <returns>Parsed subscribers activity data.</returns>
    member CampaignSubscriberActivity : campaignID:string * includeEmpty:bool opt *
        since:DateTime opt -> Dictionary<string, Export.SubsriberAction[]>

    /// <summary>Exports/dumps all Subscriber Activity for the requested campaign.</summary>
    /// <remarks>F# specific optional parameters.</remarks>
    /// <param name="campaignID">The campaign id to retrieve stats for.</param>
    /// <param name="includeEmpty">[optional] If set to true a record for every email
    /// address sent to will be returned even if there is no activity data.
    /// <para>Defaults to false.</para></param>
    /// <param name="since">[optional] Returns activity recorded since a GMT timestamp.</param>
    /// <returns>Parsed subscribers activity data.</returns>
    member CampaignSubscriberActivity : campaignID:string * ?includeEmpty:bool *
        ?since:DateTime -> Dictionary<string, Export.SubsriberAction[]>

    //------------------------------------------------------------------------------
    //  (*) Ecommerce Orders
    //------------------------------------------------------------------------------

    /// <summary>Exports/dumps all ecommerce orders for an account.</summary>
    /// <remarks>C# specific optional parameters.</remarks>
    /// <param name="since">[optional] Returns orders since a GMT timestamp.</param>
    /// <returns>Parsed ecommerce orders data.</returns>
    member EcommOrders : since:DateTime opt -> Export.EcommOrder[]

    /// <summary>Exports/dumps all ecommerce orders for an account.</summary>
    /// <remarks>F# specific optional parameters.</remarks>
    /// <param name="since">[optional] Returns orders since a GMT timestamp.</param>
    /// <returns>Parsed ecommerce orders data.</returns>
    member EcommOrders : ?since:DateTime -> Export.EcommOrder[]